<php>
    if (!function_exists('_parse_variable')) {
        function _parse_variable($option){

</php>
    <script type="text/html" id="files-item-tpl">
        <li id="saved-file{id}">
            <input id="file-{id}" type="hidden" name="file_urls[]" value="{filepath}">
            <input class="form-control" id="file-{id}-name" type="text" name="file_names[]" value="{name}"
                   style="width: 200px;" title="文件名称">
            <a id="file-{id}-preview" href="{preview_url}" target="_blank">下载</a>
            <a href="javascript:uploadOne('文件上传','#file-{id}','file');">替换</a>
            <a href="javascript:(function(){$('#saved-file{id}').remove();})();">移除</a>
        </li>
    </script>
    <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
        <div class="panel panel-default">
            <div class="panel-heading">
                <label class="form-control-widget-title">所有组件演示</label>
            </div>
            <div id="collapse-widgetName1" class="panel-collapse collapse in" role="tabpanel">
                <div class="panel-body">
                    <volist  name="option" id="data">

                            <if condition="$data.html eq '单行文本'">
                                <div class="form-group">
                                    <label class="control-label">{$data.field}<span class="form-required"></span></label>
                                    <div class="controls">
                                         <input class="id layui-form" name="{$data.id}[id]" value='{$data.id}' style="display:none;" />
                                         <input class="layui-form" name="{$data.id}[html]" value='{$data.html}' style="display:none;" />
                                         <input class="form-control layui-form" type="text" name="{$data.id}[content]" id="source" value="{$data.content}"
                                               placeholder="请输入{$data.field}">
                                         
                                        <div class="vars" style="display: inline-block;">
                                            <span>${$data.variable}</span>
                                            <a href="javascript:;" class="conname">复制代码</a>
                                        </div>
                                    </div>
                                </div>
                            <elseif condition="$data.html eq '图片'"/>
                                <div class="form-group">
                                    <label class="control-label">{$data.field}<span class="form-required"></span></label>
                                    <div class="controls">
                                        <div style="margin:0 auto;">
                                            <input class="id layui-form" name="{$data.id}[id]" value='{$data.id}' style="display:none;" />
                                            <input class="layui-form" name="{$data.id}[html]" value='{$data.html}' style="display:none;" />
                                            <input class="layui-form" name="{$data.id}[tupian]" value='{$data.content}' style="display:none;" />
                                            <input class="layui-form" type="hidden" name="{$data.id}[content]" id="thumbnail{$data.id}" value="{$data.content}">
                                            <a href="javascript:uploadOneImage('图片上传','#thumbnail{$data.id}');">
                                            <if condition="$data.content neq ''">
                                                <img src="{:cmf_get_image_preview_url($data.content)}"
                                                     id="thumbnail{$data.id}-preview"
                                                     width="135" style="cursor: pointer"/>
                                            <else />
                                                <img src="__TMPL__/public/assets/images/default-thumbnail.png"
                                                         id="thumbnail{$data.id}-preview"
                                                         width="135" style="cursor: pointer"/>
                                            </if>
                                            </a>
                                            
                                        </div>
                                        <div class="vars">
                                            <span>${$data.variable}</span>
                                            <a style="display: inline-block;margin-bottom: 15px;margin-top: 8px" href="javascript:;" class="conname">复制代码</a>
                                        </div>
                                    </div>
                                </div>
                            <elseif condition="$data.html eq '多行文本'"/>
                                <div class="form-group">
                                    <label class="control-label">{$data.field}<span class="form-required"></span></label>
                                    <div class="controls">
                                        <input class="id layui-form" name="{$data.id}[id]" value='{$data.id}' style="display:none;" />
                                        <input class="layui-form" name="{$data.id}[html]" value='{$data.html}' style="display:none;" />
                                        <textarea style="width: 100%;margin: 0" class="form-control" type="text" name="{$data.id}[content]" id="source"
                                               placeholder="请输入{$data.field}">{$data.content}</textarea>
                                        <div class="vars">
                                            <span>${$data.variable}</span>
                                            <a style="display: inline-block;margin-bottom: 15px;margin-top: 8px" href="javascript:;" class="conname">复制代码</a>
                                        </div>
                                    </div>
                                </div>
                            <else />
                                 <td>
                                    kong  
                                </td>
                            </if>
                         
                    </volist>
                </div>
            </div>
        </div>
    </div>
        
<php>
    }
}
</php>

